<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>盒模型</title>
    <style>
      .contentBox {
        width: 100px;
        padding: 20px;
        border: 5px solid red;
        margin: 20px;
      }
      .borderBox {
        float: left;
        box-sizing: border-box;
        width: 100px;
        padding: 20px;
        border: 5px solid yellow;
        margin: 30px;
      }
    </style>
  </head>
  <body>
    <!-- 
        box-sizing:content-box|border-box
        content-box:标准盒子模型-盒子总宽度=width+padding+border+margin
        border-box:怪异盒子模型-盒子总宽度=width+margin
     -->
    <div class="contentBox">content-box</div>
    <div class="borderBox">border-box</div>
  </body>
</html>
